using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using Oracle.ManagedDataAccess.Types;
using OracleInternal.Common;
using OracleInternal.Network;

namespace Oracle.ManagedDataAccess.Client
{
	public static class OracleConfiguration
	{
		internal static object s_syncObj;

		private static string m_TnsAdmin;

		private static string m_LdpAdmin;

		private static bool m_ldaporaFrTnsAdmin;

		internal static SqlNetOraConfig SNOConfig;

		private static Hashtable LdapCP;

		private static Hashtable SqlnCP;

		private static OracleDataSourceCollection s_orclDataSources;

		public static Hashtable propertySetByOcfg;

		internal static string s_walletLocation;

		internal static string DIRECTORY_SERVERS;

		internal static string DIRECTORY_SERVER_TYPE;

		internal static string DEFAULT_ADMIN_CONTEXT;

		private static OracleOnsServerCollection s_onsServers;

		public static OracleDataSourceCollection OracleDataSources
		{
			get
			{
				lock (s_syncObj)
				{
					return s_orclDataSources;
				}
			}
		}

		public static int CommandTimeout
		{
			get
			{
				lock (s_syncObj)
				{
					return ConfigBaseClass.m_commandTimeout;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string text = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(null, text, text, value);
					ConfigBaseClass.m_commandTimeout = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.CommandTimeout, $": {value}");
					}
				}
			}
		}

		public static int DbNotificationPort
		{
			get
			{
				lock (s_syncObj)
				{
					return ConfigBaseClass.m_DBNotificationPort;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string text = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(null, text, text, value);
					ConfigBaseClass.m_DBNotificationPort = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.DbNotificationPort, $": {value}");
					}
				}
			}
		}

		public static string DbNotificationAddress
		{
			get
			{
				return ConfigBaseClass.m_DBNotificationAddress;
			}
			set
			{
				string text = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
				HandleSet(null, text, text, value);
				ConfigBaseClass.m_DBNotificationAddress = value;
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.DbNotificationAddress, $": {value}");
				}
			}
		}

		public static bool UseClientInitiatedCQN
		{
			get
			{
				lock (s_syncObj)
				{
					return ConfigBaseClass.m_bUseClientInitiatedCQN;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string text = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(null, text, text, value);
					ConfigBaseClass.m_bUseClientInitiatedCQN = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.UseClientInitiatedCQN, $": {value}");
					}
				}
			}
		}

		public static bool BindByName
		{
			get
			{
				lock (s_syncObj)
				{
					return ConfigBaseClass.m_BindByName;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string text = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(null, text, text, value);
					ConfigBaseClass.m_BindByName = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.BindByName, $": {value}");
					}
				}
			}
		}

		public static int FetchSize
		{
			get
			{
				lock (s_syncObj)
				{
					return ConfigBaseClass.m_FetchSize;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string text = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(null, text, text, value);
					ConfigBaseClass.m_FetchSize = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.FetchSize, $": {value}");
					}
				}
			}
		}

		public static int MaxStatementCacheSize
		{
			get
			{
				lock (s_syncObj)
				{
					return ConfigBaseClass.m_MaxStatementCacheSize;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string text = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(null, text, text, value);
					ConfigBaseClass.m_MaxStatementCacheSize = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.MaxStatementCacheSize, $": {value}");
					}
				}
			}
		}

		public static bool SelfTuning
		{
			get
			{
				lock (s_syncObj)
				{
					return ConfigBaseClass.m_SelfTuning;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string text = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(null, text, text, value);
					ConfigBaseClass.m_SelfTuning = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.SelfTuning, $": {value}");
					}
				}
			}
		}

		public static int StatementCacheSize
		{
			get
			{
				lock (s_syncObj)
				{
					return ConfigBaseClass.m_StatementCacheSize;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string text = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(null, text, text, value);
					ConfigBaseClass.m_StatementCacheSize = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.StatementCacheSize, $": {value}");
					}
				}
			}
		}

		public static long PerformanceCounters
		{
			get
			{
				return ConfigBaseClass.m_PerformanceCounters;
			}
			set
			{
				string text = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
				HandleSet(null, text, text, value);
				ConfigBaseClass.m_PerformanceCounters = value;
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.PerformanceCounters, $": {value}");
				}
			}
		}

		public static string TnsAdmin
		{
			get
			{
				lock (s_syncObj)
				{
					return ConfigBaseClass.m_TnsAdminLocation;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string text = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(null, text, text, value);
					ConfigBaseClass.m_TnsAdminLocation = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.TnsAdmin, $": {value}");
					}
				}
			}
		}

		public static string LdapAdmin
		{
			get
			{
				return ConfigBaseClass.m_LdapAdminLocation;
			}
			set
			{
				string text = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
				HandleSet(null, text, text, value);
				ConfigBaseClass.m_LdapAdminLocation = value;
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.LdapAdmin, $": {value}");
				}
			}
		}

		public static string ServiceRelocationConnectionTimeout
		{
			get
			{
				lock (s_syncObj)
				{
					return ConfigBaseClass.m_serviceRelocationTimeout;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string text = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(null, text, text, value);
					ProcessSRCT(value);
					ConfigBaseClass.m_serviceRelocationTimeout = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.ServiceRelocationConnectionTimeout, $": {value}");
					}
				}
			}
		}

		public static string ChunkMigrationConnectionTimeout
		{
			get
			{
				lock (s_syncObj)
				{
					return ConfigBaseClass.m_chunkMigrationTimeout;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string text = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(null, text, text, value);
					ProcessCMCT(value);
					ConfigBaseClass.m_chunkMigrationTimeout = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.ChunkMigrationConnectionTimeout, $": {value}");
					}
				}
			}
		}

		public static string TraceFileLocation
		{
			get
			{
				lock (s_syncObj)
				{
					if (TracingState.s_bTracingStarted)
					{
						return ConfigBaseClass.m_singleTraceFileLocation;
					}
					return ConfigBaseClass.m_traceFileLocation;
				}
			}
			set
			{
				string text = null;
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.TraceFileLocation, $" trying to change from {ConfigBaseClass.m_traceFileLocation} to {value}");
				lock (s_syncObj)
				{
					if (value != ConfigBaseClass.m_traceFileLocation)
					{
						propertySetByOcfg[OracleTraceFuncName.TraceFileLocation.ToString()] = value;
						ConfigBaseClass.m_traceFileLocation = value;
						ConfigBaseClass.m_singleTraceFileLocation = value;
						text = $": {value}";
					}
				}
				if (text != null && ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.TraceFileLocation, text);
				}
			}
		}

		public static int TraceLevel
		{
			get
			{
				lock (s_syncObj)
				{
					return ConfigBaseClass.m_TraceLevel & 0xFFFFFFF;
				}
			}
			set
			{
				string text = null;
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.TraceLevel, $"trying to change from {ConfigBaseClass.m_TraceOption} to {value}");
				lock (s_syncObj)
				{
					if (value != ConfigBaseClass.m_TraceLevel)
					{
						propertySetByOcfg[OracleTraceFuncName.TraceLevel.ToString()] = value;
						text = $": {value}";
						ConfigBaseClass.m_TraceLevel = value;
						if (value > 0)
						{
							Trace.Init();
						}
					}
				}
				if (text != null)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.TraceLevel, text);
				}
			}
		}

		public static int TraceOption
		{
			get
			{
				lock (s_syncObj)
				{
					return ConfigBaseClass.m_TraceOption;
				}
			}
			set
			{
				string text = null;
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.TraceOption, $"trying to change from {ConfigBaseClass.m_TraceOption} to {value}");
				}
				lock (s_syncObj)
				{
					if (value != ConfigBaseClass.m_TraceOption)
					{
						propertySetByOcfg[OracleTraceFuncName.TraceOption.ToString()] = value;
						ConfigBaseClass.m_TraceOption = value;
						text = $" {ConfigBaseClass.m_TraceOption}";
					}
				}
				if (text != null && ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.TraceOption, text);
				}
			}
		}

		public static int TraceFileMaxSize
		{
			get
			{
				lock (s_syncObj)
				{
					return (int)(ConfigBaseClass.m_TraceFileMaxSize / 1048576);
				}
			}
			set
			{
				string text = null;
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.TraceFileMaxSize, $" trying to change from {ConfigBaseClass.m_TraceFileMaxSize} to : {value}");
				}
				lock (s_syncObj)
				{
					if (value != ConfigBaseClass.m_TraceFileMaxSize)
					{
						propertySetByOcfg[OracleTraceFuncName.TraceFileMaxSize.ToString()] = value;
						if (value <= 0)
						{
							value = 100;
						}
						ConfigBaseClass.m_TraceFileMaxSize = (long)value * 1024L * 1024;
						text = $": {value}";
					}
				}
				if (text != null && ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.TraceFileMaxSize, text);
				}
			}
		}

		public static bool HAEvents
		{
			get
			{
				lock (s_syncObj)
				{
					return ConfigBaseClass.m_haEvents;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string text = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(null, text, text, value);
					ConfigBaseClass.m_haEvents = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.HAEvents, $": {value}");
					}
				}
			}
		}

		public static bool LoadBalancing
		{
			get
			{
				lock (s_syncObj)
				{
					return ConfigBaseClass.m_loadBalancing;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string text = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(null, text, text, value);
					ConfigBaseClass.m_loadBalancing = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.LoadBalancing, $": {value}");
					}
				}
			}
		}

		public static string DrcpConnectionClass
		{
			get
			{
				lock (s_syncObj)
				{
					return ConfigBaseClass.m_connectionClass;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string text = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(null, text, text, value);
					ConfigBaseClass.m_connectionClass = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.DrcpConnectionClass, $": {value}");
					}
				}
			}
		}

		public static string DatabaseEditionName
		{
			get
			{
				lock (s_syncObj)
				{
					return ConfigBaseClass.m_appEdition;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string text = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(null, text, text, value);
					ConfigBaseClass.m_appEdition = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.DatabaseEditionName, $": {value}");
					}
				}
			}
		}

		public static bool SSLServerDNMatch
		{
			get
			{
				lock (s_syncObj)
				{
					return SNOConfig.SSLServerDNMatch;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string propName = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(SqlnCP, propName, "ssl_server_dn_match", value);
					SNOConfig.SSLServerDNMatch = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.SSLServerDNMatch, $": {value}");
					}
				}
			}
		}

		public static string SSLVersion
		{
			get
			{
				lock (s_syncObj)
				{
					return SNOConfig.SSLVersion;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string propName = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(SqlnCP, propName, "ssl_version", value);
					SNOConfig.SSLVersion = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.SSLVersion, $": {value}");
					}
				}
			}
		}

		public static string SqlNetAuthenticationServices
		{
			get
			{
				lock (s_syncObj)
				{
					string result = string.Empty;
					if (ConfigBaseClass.m_configParameters.ContainsKey("sqlnet.authentication_services"))
					{
						object obj = ConfigBaseClass.m_configParameters["sqlnet.authentication_services"];
						if (obj != null)
						{
							result = obj as string;
						}
					}
					return result;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string propName = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(SqlnCP, propName, "sqlnet.authentication_services", value, checknull: true);
					SNOConfig.m_bSqlNetAuthenticationServices_accessed = false;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.SqlNetAuthenticationServices, $": {value}");
					}
				}
			}
		}

		public static string SqlNetEncryptionTypesClient
		{
			get
			{
				lock (s_syncObj)
				{
					string result = string.Empty;
					if (ConfigBaseClass.m_configParameters.ContainsKey("sqlnet.encryption_types_client"))
					{
						object obj = ConfigBaseClass.m_configParameters["sqlnet.encryption_types_client"];
						if (obj != null)
						{
							result = obj as string;
						}
					}
					return result;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string propName = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(SqlnCP, propName, "sqlnet.encryption_types_client", value, checknull: true);
					SNOConfig.m_bSqlNetEncryptionTypesClient_accessed = false;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.SqlNetEncryptionTypesClient, $": {value}");
					}
				}
			}
		}

		public static string SqlNetEncryptionClient
		{
			get
			{
				lock (s_syncObj)
				{
					return SNOConfig.SqlNetEncryptionClient;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string propName = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(SqlnCP, propName, "sqlnet.encryption_client", value);
					SNOConfig.SqlNetEncryptionClient = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.SqlNetEncryptionClient, $": {value}");
					}
				}
			}
		}

		public static string SqlNetCryptoChecksumTypesClient
		{
			get
			{
				lock (s_syncObj)
				{
					string result = string.Empty;
					if (ConfigBaseClass.m_configParameters.ContainsKey("sqlnet.crypto_checksum_types_client"))
					{
						object obj = ConfigBaseClass.m_configParameters["sqlnet.crypto_checksum_types_client"];
						if (obj != null)
						{
							result = obj as string;
						}
					}
					return result;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string propName = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(SqlnCP, propName, "sqlnet.crypto_checksum_types_client", value, checknull: true);
					SNOConfig.m_bSqlNetCryptoChecksumTypesClient_accessed = false;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.SqlNetCryptoChecksumTypesClient, $": {value}");
					}
				}
			}
		}

		public static string SqlNetCryptoChecksumClient
		{
			get
			{
				lock (s_syncObj)
				{
					return SNOConfig.SqlNetCryptoChecksumClient;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string propName = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(SqlnCP, propName, "sqlnet.crypto_checksum_client", value);
					SNOConfig.SqlNetCryptoChecksumClient = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.SqlNetCryptoChecksumClient, $": {value}");
					}
				}
			}
		}

		public static bool SqlNetWalletOverride
		{
			get
			{
				lock (s_syncObj)
				{
					return SNOConfig.WalletOverride;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string propName = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(SqlnCP, propName, "sqlnet.wallet_override", value);
					SNOConfig.WalletOverride = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.SqlNetWalletOverride, $": {value}");
					}
				}
			}
		}

		public static string NamesDirectoryPath
		{
			get
			{
				lock (s_syncObj)
				{
					string result = string.Empty;
					if (ConfigBaseClass.m_configParameters.ContainsKey("names.directory_path"))
					{
						object obj = ConfigBaseClass.m_configParameters["names.directory_path"];
						if (obj != null)
						{
							result = obj as string;
						}
					}
					return result;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string propName = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(SqlnCP, propName, "names.directory_path", value, checknull: true);
					SNOConfig.m_bNamesDirectoryPath_accessed = false;
					AddressResolution.SetNewNDP(SNOConfig.NamesDirectoryPath);
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.NamesDirectoryPath, $": {value}");
					}
				}
			}
		}

		public static bool NamesLdapAuthenticateBind
		{
			get
			{
				return SNOConfig.NamesLdapAuthenticateBind;
			}
			set
			{
				string propName = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
				HandleSet(SqlnCP, propName, "names.ldap_authenticate_bind", value);
				SNOConfig.NamesLdapAuthenticateBind = value;
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.NamesLdapAuthenticateBind, $": {value}");
				}
			}
		}

		public static int NamesLdapConnTimeout
		{
			get
			{
				return SNOConfig.LDAPCTimeout;
			}
			set
			{
				string propName = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
				HandleSet(SqlnCP, propName, "names.ldap_conn_timeout", value);
				SNOConfig.LDAPCTimeout = value;
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.NamesLdapConnTimeout, $": {value}");
				}
			}
		}

		public static string WalletLocation
		{
			get
			{
				lock (s_syncObj)
				{
					return s_walletLocation;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string propName = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(SqlnCP, propName, "wallet_location", value);
					s_walletLocation = value;
					SNOConfig.m_walletLocation_accessed = false;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.WalletLocation, $": {value}");
					}
				}
			}
		}

		public static int TcpConnectTimeout
		{
			get
			{
				lock (s_syncObj)
				{
					return int.Parse(SNOConfig.TCPCTimeOut);
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string propName = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(SqlnCP, propName, "tcp.connect_timeout", value);
					SNOConfig.TCPCTimeOut = value.ToString();
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.TcpConnectTimeout, $": {value}");
					}
				}
			}
		}

		public static bool DisableOOB
		{
			get
			{
				lock (s_syncObj)
				{
					return SNOConfig.DisableOOB;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string propName = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(SqlnCP, propName, "disable_oob", value);
					SNOConfig.DisableOOB = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.DisableOOB, $": {value}");
					}
				}
			}
		}

		public static bool TcpNoDelay
		{
			get
			{
				lock (s_syncObj)
				{
					return SNOConfig.NoDelay;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string propName = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(SqlnCP, propName, "tcp.nodelay", value);
					SNOConfig.NoDelay = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.TcpNoDelay, $": {value}");
					}
				}
			}
		}

		public static int SendBufferSize
		{
			get
			{
				lock (s_syncObj)
				{
					return SNOConfig.SendBufSize;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string propName = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(SqlnCP, propName, "send_buf_size", value);
					SNOConfig.SendBufSize = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.SendBufferSize, $": {value}");
					}
				}
			}
		}

		public static int ReceiveBufferSize
		{
			get
			{
				lock (s_syncObj)
				{
					return SNOConfig.RecvBufSize;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					string propName = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(SqlnCP, propName, "recv_buf_size", value);
					SNOConfig.RecvBufSize = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.ReceiveBufferSize, $": {value}");
					}
				}
			}
		}

		[Obsolete("This property will soon be deprecated. Use DirectoryServerType instead.")]
		public static string DirectoryType
		{
			get
			{
				return DirectoryServerType;
			}
			set
			{
				DirectoryServerType = value;
			}
		}

		public static string DirectoryServerType
		{
			get
			{
				return (string)ConfigBaseClass.m_LDAPconfigParameters[DIRECTORY_SERVER_TYPE];
			}
			set
			{
				string propName = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
				HandleSet(LdapCP, propName, DIRECTORY_SERVER_TYPE, value);
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.DirectoryType, $": {value}");
				}
			}
		}

		public static string DefaultAdminContext
		{
			get
			{
				return (string)ConfigBaseClass.m_LDAPconfigParameters[DEFAULT_ADMIN_CONTEXT];
			}
			set
			{
				string propName = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
				HandleSet(LdapCP, propName, DEFAULT_ADMIN_CONTEXT, value);
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.DefaultAdminContext, $": {value}");
				}
			}
		}

		public static string DirectoryServers
		{
			get
			{
				return (string)ConfigBaseClass.m_LDAPconfigParameters[DIRECTORY_SERVERS];
			}
			set
			{
				string propName = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
				HandleSet(LdapCP, propName, DIRECTORY_SERVERS, value);
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.DirectoryServers, $": {value}");
				}
			}
		}

		public static string OnsConfigFile
		{
			get
			{
				lock (s_syncObj)
				{
					return ConfigBaseClass.m_ONSConfigFile;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					if (OracleConnection.m_bAtLeastOneConOpen)
					{
						throw new InvalidOperationException(OracleStringResourceManager.GetErrorMesg(ResourceStringConstants.CANNOT_MODIFY_ORACONFIG));
					}
					if (!propertySetByOcfg.ContainsKey(OracleTraceFuncName.OnsConfigFile.ToString()))
					{
						propertySetByOcfg.Add(OracleTraceFuncName.OnsConfigFile.ToString(), true);
					}
					ConfigBaseClass.m_ONSConfigFile = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.OnsConfigFile, $": {value}");
					}
					if (ConfigBaseClass.m_ONSMode == OnsConfigMode.remote && !string.IsNullOrWhiteSpace(ConfigBaseClass.m_ONSConfigFile))
					{
						ConfigBaseClass.m_nodeListFromConfFile = GetPropertyFromONSConfig(ConfigBaseClass.m_ONSConfigFile, ConfigInfo.ONSNodes);
						if (ProviderConfig.m_bTraceLevelPublic)
						{
							Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.OnsConfigFile, $"m_nodeListFromConfFile : {ConfigBaseClass.m_nodeListFromConfFile}");
						}
					}
					else
					{
						ConfigBaseClass.m_nodeListFromConfFile = null;
						if (ProviderConfig.m_bTraceLevelPublic)
						{
							Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.OnsConfigFile, $"m_nodeListFromConfFile : null");
						}
					}
				}
			}
		}

		public static OnsConfigMode OnsMode
		{
			get
			{
				lock (s_syncObj)
				{
					return ConfigBaseClass.m_ONSMode;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					if (OracleConnection.m_bAtLeastOneConOpen)
					{
						throw new InvalidOperationException(OracleStringResourceManager.GetErrorMesg(ResourceStringConstants.CANNOT_MODIFY_ORACONFIG));
					}
					if (!propertySetByOcfg.ContainsKey(OracleTraceFuncName.OnsMode.ToString()))
					{
						propertySetByOcfg.Add(OracleTraceFuncName.OnsMode.ToString(), true);
					}
					ConfigBaseClass.m_ONSMode = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.OnsMode, $": {value}");
					}
					if (ConfigBaseClass.m_ONSMode == OnsConfigMode.remote && !string.IsNullOrWhiteSpace(ConfigBaseClass.m_ONSConfigFile))
					{
						ConfigBaseClass.m_nodeListFromConfFile = GetPropertyFromONSConfig(ConfigBaseClass.m_ONSConfigFile, ConfigInfo.ONSNodes);
						if (ProviderConfig.m_bTraceLevelPublic)
						{
							Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.OnsMode, $"m_nodeListFromConfFile : {ConfigBaseClass.m_nodeListFromConfFile}");
						}
					}
					else
					{
						ConfigBaseClass.m_nodeListFromConfFile = null;
						if (ProviderConfig.m_bTraceLevelPublic)
						{
							Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.OnsMode, $"m_nodeListFromConfFile : null");
						}
					}
				}
			}
		}

		public static string OnsProtocol
		{
			get
			{
				lock (s_syncObj)
				{
					return ConfigBaseClass.m_ONSProtocol;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					if (OracleConnection.m_bAtLeastOneConOpen)
					{
						throw new InvalidOperationException(OracleStringResourceManager.GetErrorMesg(ResourceStringConstants.CANNOT_MODIFY_ORACONFIG));
					}
					if (!propertySetByOcfg.ContainsKey(OracleTraceFuncName.OnsProtocol.ToString()))
					{
						propertySetByOcfg.Add(OracleTraceFuncName.OnsProtocol.ToString(), true);
					}
					ConfigBaseClass.m_ONSProtocol = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.OnsProtocol, $"OnsProtocol : {ConfigBaseClass.m_ONSProtocol}");
					}
				}
			}
		}

		public static string OnsWalletLocation
		{
			get
			{
				lock (s_syncObj)
				{
					return ConfigBaseClass.m_ONSWalletLocation;
				}
			}
			set
			{
				lock (s_syncObj)
				{
					if (OracleConnection.m_bAtLeastOneConOpen)
					{
						throw new InvalidOperationException(OracleStringResourceManager.GetErrorMesg(ResourceStringConstants.CANNOT_MODIFY_ORACONFIG));
					}
					if (!propertySetByOcfg.ContainsKey(OracleTraceFuncName.OnsWalletLocation.ToString()))
					{
						propertySetByOcfg.Add(OracleTraceFuncName.OnsWalletLocation.ToString(), true);
					}
					ConfigBaseClass.m_ONSWalletLocation = value;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.OnsWalletLocation, $"OnsWalletLocation : {ConfigBaseClass.m_ONSWalletLocation}");
					}
				}
			}
		}

		public static OracleOnsServerCollection OracleOnsServers
		{
			get
			{
				lock (s_syncObj)
				{
					return s_onsServers;
				}
			}
		}

		public static string SqlnetURI
		{
			get
			{
				return SNOConfig.SQLNetURI;
			}
			set
			{
				lock (s_syncObj)
				{
					string propName = MethodBase.GetCurrentMethod()!.Name.Replace("set_", "");
					HandleSet(SqlnCP, propName, "sqlnet.uri", value, checknull: true);
					SNOConfig.m_sqlNetURI_accessed = false;
					if (ProviderConfig.m_bTraceLevelPublic)
					{
						Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.SqlnetURI, $": {value}");
					}
				}
			}
		}

		static OracleConfiguration()
		{
			m_TnsAdmin = null;
			m_LdpAdmin = null;
			m_ldaporaFrTnsAdmin = false;
			SNOConfig = new SqlNetOraConfig(ConfigBaseClass.m_configParameters);
			LdapCP = ConfigBaseClass.m_LDAPconfigParameters;
			SqlnCP = ConfigBaseClass.m_configParameters;
			s_orclDataSources = new OracleDataSourceCollection();
			propertySetByOcfg = new Hashtable();
			s_walletLocation = "";
			DIRECTORY_SERVERS = "DIRECTORY_SERVERS";
			DIRECTORY_SERVER_TYPE = "DIRECTORY_SERVER_TYPE";
			DEFAULT_ADMIN_CONTEXT = "DEFAULT_ADMIN_CONTEXT";
			s_onsServers = new OracleOnsServerCollection();
			s_syncObj = new object();
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleConnection, OracleTraceFuncName.ctor);
			}
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleConnection, OracleTraceFuncName.ctor);
			}
		}

		private static void HandleSet(Hashtable theParams, string propName, string paramName, object value, bool checknull = false)
		{
			if (OracleConnection.m_bAtLeastOneConOpen)
			{
				throw new InvalidOperationException(OracleStringResourceManager.GetErrorMesg(ResourceStringConstants.CANNOT_MODIFY_ORACONFIG));
			}
			if (checknull && string.IsNullOrEmpty((string)value))
			{
				throw new ArgumentException();
			}
			if (!propertySetByOcfg.ContainsKey(propName))
			{
				propertySetByOcfg.Add(propName, true);
			}
			ConfigBaseClass.m_configParamFrSqlnetora.Remove(paramName);
			if (theParams != null)
			{
				theParams[paramName] = value;
			}
			ConfigBaseClass.m_oracleConfigParameters[paramName] = value;
		}

		internal static void DumpInfo()
		{
			StringBuilder stringBuilder = new StringBuilder();
			lock (s_syncObj)
			{
				if (propertySetByOcfg.ContainsKey(OracleTraceFuncName.TraceFileLocation.ToString()))
				{
					stringBuilder.AppendLine($" TraceFileLocation : {TraceFileLocation}");
				}
				if (propertySetByOcfg.ContainsKey(OracleTraceFuncName.TraceLevel.ToString()))
				{
					stringBuilder.AppendLine($" TraceLevel : {TraceLevel & 0xFFFFFFF}");
				}
				if (propertySetByOcfg.ContainsKey(OracleTraceFuncName.TraceOption.ToString()))
				{
					stringBuilder.AppendLine($" TraceOption : {TraceOption}");
				}
				if (propertySetByOcfg.ContainsKey(OracleTraceFuncName.TraceFileMaxSize.ToString()))
				{
					stringBuilder.AppendLine($" TraceFileMaxSize : {TraceFileMaxSize}");
				}
				if (propertySetByOcfg.ContainsKey(OracleTraceFuncName.CommandTimeout.ToString()))
				{
					stringBuilder.AppendLine($" CommandTimeout : {CommandTimeout}");
				}
				if (propertySetByOcfg.ContainsKey(OracleTraceFuncName.DbNotificationPort.ToString()))
				{
					stringBuilder.AppendLine($" DbNotificationPort : {DbNotificationPort}");
				}
				if (propertySetByOcfg.ContainsKey(OracleTraceFuncName.DbNotificationAddress.ToString()))
				{
					stringBuilder.AppendLine($" DbNotificationAddress: {DbNotificationAddress}");
				}
				if (propertySetByOcfg.ContainsKey(OracleTraceFuncName.BindByName.ToString()))
				{
					stringBuilder.AppendLine($" BindByName : {BindByName}");
				}
				if (propertySetByOcfg.ContainsKey(OracleTraceFuncName.FetchSize.ToString()))
				{
					stringBuilder.AppendLine($" FetchSize : {FetchSize}");
				}
				if (propertySetByOcfg.ContainsKey(OracleTraceFuncName.MaxStatementCacheSize.ToString()))
				{
					stringBuilder.AppendLine($" MaxStatementCacheSize : {MaxStatementCacheSize}");
				}
				if (propertySetByOcfg.ContainsKey(OracleTraceFuncName.SelfTuning.ToString()))
				{
					stringBuilder.AppendLine($" SelfTuning : {SelfTuning}");
				}
				if (propertySetByOcfg.ContainsKey(OracleTraceFuncName.StatementCacheSize.ToString()))
				{
					stringBuilder.AppendLine($" StatementCacheSize : {StatementCacheSize}");
				}
				if (propertySetByOcfg.ContainsKey("TNS_ADMIN"))
				{
					stringBuilder.AppendLine($" TnsAdmin : {TnsAdmin}");
				}
				if (propertySetByOcfg.ContainsKey(OracleTraceFuncName.ServiceRelocationConnectionTimeout.ToString()))
				{
					stringBuilder.AppendLine($" ServiceRelocationConnectionTimeout : {ServiceRelocationConnectionTimeout}");
				}
				if (propertySetByOcfg.ContainsKey(OracleTraceFuncName.ChunkMigrationConnectionTimeout.ToString()))
				{
					stringBuilder.AppendLine($" ChunkMigrationConnectionTimeout : {ChunkMigrationConnectionTimeout}");
				}
				if (propertySetByOcfg.ContainsKey(OracleTraceFuncName.HAEvents.ToString()))
				{
					stringBuilder.AppendLine($" HAEvents : {HAEvents} ");
				}
				if (propertySetByOcfg.ContainsKey(OracleTraceFuncName.LoadBalancing.ToString()))
				{
					stringBuilder.AppendLine($" LoadBalancing : {LoadBalancing}");
				}
				if (propertySetByOcfg.ContainsKey(OracleTraceFuncName.DrcpConnectionClass.ToString()))
				{
					stringBuilder.AppendLine($" DrcpConnectionClass : {DrcpConnectionClass}");
				}
				if (propertySetByOcfg.ContainsKey(OracleTraceFuncName.DatabaseEditionName.ToString()))
				{
					stringBuilder.AppendLine($" DatabaseEditionName : {DatabaseEditionName}");
				}
				if (ConfigBaseClass.m_configParameters.ContainsKey("ssl_server_dn_match") && propertySetByOcfg.ContainsKey(OracleTraceFuncName.SSLServerDNMatch.ToString()))
				{
					stringBuilder.AppendLine($" SSLServerDNMatch : {SSLServerDNMatch}");
				}
				if (ConfigBaseClass.m_configParameters.ContainsKey("ssl_version") && propertySetByOcfg.ContainsKey(OracleTraceFuncName.SSLVersion.ToString()))
				{
					stringBuilder.AppendLine($" SSLVersion : {SSLVersion}");
				}
				if (ConfigBaseClass.m_configParameters.ContainsKey("sqlnet.authentication_services") && propertySetByOcfg.ContainsKey(OracleTraceFuncName.SqlNetAuthenticationServices.ToString()))
				{
					stringBuilder.AppendLine($" SqlNetAuthenticationServices : {SqlNetAuthenticationServices}");
				}
				if (ConfigBaseClass.m_configParameters.ContainsKey("sqlnet.encryption_types_client") && propertySetByOcfg.ContainsKey(OracleTraceFuncName.SqlNetEncryptionTypesClient.ToString()))
				{
					stringBuilder.AppendLine($" SqlNetEncryptionTypesClient : {SqlNetEncryptionTypesClient}");
				}
				if (ConfigBaseClass.m_configParameters.ContainsKey("sqlnet.encryption_client") && propertySetByOcfg.ContainsKey(OracleTraceFuncName.SqlNetEncryptionClient.ToString()))
				{
					stringBuilder.AppendLine($" SqlNetEncryptionClient : {SqlNetEncryptionClient}");
				}
				if (ConfigBaseClass.m_configParameters.ContainsKey("sqlnet.crypto_checksum_types_client") && propertySetByOcfg.ContainsKey(OracleTraceFuncName.SqlNetCryptoChecksumTypesClient.ToString()))
				{
					stringBuilder.AppendLine($" SqlNetCryptoChecksumTypesClient : {SqlNetCryptoChecksumTypesClient}");
				}
				if (ConfigBaseClass.m_configParameters.ContainsKey("sqlnet.crypto_checksum_client") && propertySetByOcfg.ContainsKey(OracleTraceFuncName.SqlNetCryptoChecksumClient.ToString()))
				{
					stringBuilder.AppendLine($" SqlNetCryptoChecksumClient : {SqlNetCryptoChecksumClient}");
				}
				if (ConfigBaseClass.m_configParameters.ContainsKey("sqlnet.wallet_override") && propertySetByOcfg.ContainsKey(OracleTraceFuncName.SqlNetWalletOverride.ToString()))
				{
					stringBuilder.AppendLine($" SqlNetWalletOverride : {SqlNetWalletOverride}");
				}
				if (ConfigBaseClass.m_configParameters.ContainsKey("wallet_location") && propertySetByOcfg.ContainsKey(OracleTraceFuncName.WalletLocation.ToString()))
				{
					stringBuilder.AppendLine($" WalletLocation : {s_walletLocation}");
				}
				if (ConfigBaseClass.m_configParameters.ContainsKey("names.directory_path") && propertySetByOcfg.ContainsKey(OracleTraceFuncName.NamesDirectoryPath.ToString()))
				{
					stringBuilder.AppendLine($" NamesDirectoryPath : {NamesDirectoryPath}");
				}
				if (ConfigBaseClass.m_configParameters.ContainsKey("tcp.connect_timeout") && propertySetByOcfg.ContainsKey(OracleTraceFuncName.TcpConnectTimeout.ToString()))
				{
					stringBuilder.AppendLine($" TcpConnectTimeout : {TcpConnectTimeout}");
				}
				if (ConfigBaseClass.m_configParameters.ContainsKey("disable_oob") && propertySetByOcfg.ContainsKey(OracleTraceFuncName.DisableOOB.ToString()))
				{
					stringBuilder.AppendLine($" DisableOOB : {DisableOOB}");
				}
				if (ConfigBaseClass.m_configParameters.ContainsKey("nodelay") && propertySetByOcfg.ContainsKey(OracleTraceFuncName.TcpNoDelay.ToString()))
				{
					stringBuilder.AppendLine($" TcpNoDelay : {TcpNoDelay}");
				}
				if (ConfigBaseClass.m_configParameters.ContainsKey("send_buf_size") && propertySetByOcfg.ContainsKey(OracleTraceFuncName.SendBufferSize.ToString()))
				{
					stringBuilder.AppendLine($" SendBufferSize : {SendBufferSize}");
				}
				if (ConfigBaseClass.m_configParameters.ContainsKey("recv_buf_size") && propertySetByOcfg.ContainsKey(OracleTraceFuncName.ReceiveBufferSize.ToString()))
				{
					stringBuilder.AppendLine($" ReceiveBufferSize : {ReceiveBufferSize}");
				}
				if (propertySetByOcfg.ContainsKey(OracleTraceFuncName.OnsConfigFile.ToString()))
				{
					stringBuilder.AppendLine($" OnsConfigFile : {OnsConfigFile}");
				}
				if (propertySetByOcfg.ContainsKey(OracleTraceFuncName.OnsMode.ToString()))
				{
					stringBuilder.AppendLine($" OnsMode : {OnsMode}");
				}
				if (propertySetByOcfg.ContainsKey(OracleTraceFuncName.OnsProtocol.ToString()))
				{
					stringBuilder.AppendLine($" OnsProtocol : {OnsProtocol}");
				}
				if (propertySetByOcfg.ContainsKey(OracleTraceFuncName.OnsWalletLocation.ToString()))
				{
					stringBuilder.AppendLine($" OnsWalletLocation : {OnsWalletLocation}");
				}
				if (propertySetByOcfg.ContainsKey("DirectoryServerType"))
				{
					stringBuilder.AppendLine($" DirectoryServerType : {DirectoryServerType}");
				}
				if (propertySetByOcfg.ContainsKey("DirectoryServers"))
				{
					stringBuilder.AppendLine($" DirectoryServers : {DirectoryServers}");
				}
				if (propertySetByOcfg.ContainsKey("DefaultAdminContext"))
				{
					stringBuilder.AppendLine($" DefaultAdminContext : {DefaultAdminContext}");
				}
				if (propertySetByOcfg.ContainsKey("NamesLdapAuthenticateBind"))
				{
					stringBuilder.AppendLine($" NamesLdapAuthenticateBind : {NamesLdapAuthenticateBind}");
				}
				if (propertySetByOcfg.ContainsKey("NamesLdapConnTimeout"))
				{
					stringBuilder.AppendLine($" NamesLdapConnTimeout : {NamesLdapConnTimeout}");
				}
				if (propertySetByOcfg.ContainsKey("LdapAdmin"))
				{
					stringBuilder.AppendLine($"LdapAdmin : {LdapAdmin}");
				}
				if (propertySetByOcfg.ContainsKey("sqlnet.uri"))
				{
					stringBuilder.AppendLine($" SQLNET_URI : {SqlnetURI}");
				}
				foreach (string key in ConfigBaseClass.m_configDataSourcesMap.Keys)
				{
					stringBuilder.AppendLine($" OracleDataSources : {key} : {ConfigBaseClass.m_configDataSourcesMap[key]}");
				}
				foreach (string key2 in ConfigBaseClass.m_ONSMapping.Keys)
				{
					stringBuilder.AppendLine($" OracleOnsServers : {key2} : {OracleOnsServerCollection.s_userCopyOfEntries[key2]}");
				}
			}
			Trace.Write(OracleTraceLevel.Config, OracleTraceTag.Config, OracleTraceClassName.OracleConfiguration, OracleTraceFuncName.DumpInfo, stringBuilder.ToString());
		}

		internal static string GetPropertyFromONSConfig(string ONSConfigFile, string onsConfigProperty)
		{
			lock (s_syncObj)
			{
				string result = null;
				if (File.Exists(ONSConfigFile))
				{
					using (StreamReader strmRdr = new StreamReader(ONSConfigFile))
					{
						string leftover;
						string[] name = GetName(strmRdr, out leftover);
						while (name != null && name.Length != 0)
						{
							string value = GetValue(strmRdr, leftover);
							string[] array = name;
							for (int i = 0; i < array.Length; i++)
							{
								if (array[i].ToLowerInvariant() == onsConfigProperty)
								{
									result = value;
								}
								name = GetName(strmRdr, out leftover);
							}
						}
						return result;
					}
				}
				throw new FileNotFoundException(OracleStringResourceManager.GetErrorMesg(ResourceStringConstants.ONS_FILE_NOT_EXIST, "Config File", ONSConfigFile));
			}
		}

		private static string[] GetName(StreamReader strmRdr, out string leftover)
		{
			lock (s_syncObj)
			{
				string[] result = null;
				int num = -1;
				leftover = "";
				while (num == -1 && !strmRdr.EndOfStream)
				{
					string text = strmRdr.ReadLine()!.Trim();
					if (text.Length > 0 && text[0] == '#')
					{
						continue;
					}
					num = text.IndexOf('=');
					if (num != -1)
					{
						result = (from s in text.Substring(0, num).Split(',')
							select s.Trim() into s
							where s != string.Empty
							select s).ToArray();
						leftover = text.Substring(num + 1);
					}
				}
				return result;
			}
		}

		private static string GetValue(StreamReader strmRdr, string leftover)
		{
			lock (s_syncObj)
			{
				bool flag = false;
				string text = "";
				string text2 = "";
				int num = 0;
				int num2 = -1;
				try
				{
					text2 = leftover.Trim();
					while ((text2.Length == 0 || text2[0] == '#') && !strmRdr.EndOfStream)
					{
						text2 = strmRdr.ReadLine()!.Trim();
					}
					if (text2.Contains('#'))
					{
						num2 = text2.IndexOf('#');
						if (num2 != -1)
						{
							text2 = text2.Substring(0, num2);
							text2.Trim();
						}
					}
					if (text2.Length <= 0 || text2[0] != '(')
					{
						return text2.Trim();
					}
					int num3;
					do
					{
						if (text2.Length <= 0 || text2[0] == '#')
						{
							continue;
						}
						flag = false;
						int i;
						for (i = 0; i < text2.Length; i++)
						{
							if (flag)
							{
								flag = false;
								continue;
							}
							switch (text2[i])
							{
							case '(':
								num++;
								break;
							case ')':
								num--;
								break;
							case '#':
								text2 = text2.Remove(i--);
								break;
							case '\\':
								if (i + 1 == text2.Length)
								{
									text2 = text2.Remove(i--, 1);
									flag = true;
								}
								else if (ConfigBaseClass.m_parens.Contains(text2[i + 1]))
								{
									text2 = text2.Remove(i--, 1);
								}
								else
								{
									flag = true;
								}
								break;
							}
							if (num == 0 && i + 1 != text2.Length)
							{
								string text3 = text2.Substring(i + 1, text2.Length - (i + 1)).Trim();
								if (!string.IsNullOrEmpty(text3) && text3[0] != '#' && text3[0] != ')')
								{
									return null;
								}
								text2 = text2.Remove(i + 1);
							}
						}
						text += text2.Substring(0, i);
					}
					while (num != 0 && (num3 = strmRdr.Peek()) != -1 && (ConfigBaseClass.m_allowedCont.Contains((char)num3) || ((ushort)num3 == 41 && num == 1) || flag) && !strmRdr.EndOfStream && (text2 = strmRdr.ReadLine()!.Trim()).Length >= 0);
				}
				catch (Exception)
				{
				}
				return text;
			}
		}

		internal static void ProcessSRCT(string value)
		{
			if (value == null)
			{
				return;
			}
			string[] array = value.Split('+');
			if (array.Length == 1)
			{
				array[0] = array[0].Trim();
				try
				{
					if (string.Equals(array[0], "drain_timeout", StringComparison.InvariantCultureIgnoreCase))
					{
						ConfigBaseClass.s_bDrainTimeoutInSRCT = true;
					}
					else
					{
						ConfigBaseClass.srctOffset = Convert.ToInt32(array[0]);
					}
					ConfigBaseClass.s_bFromConfigSRCT = true;
				}
				catch
				{
					throw;
				}
				return;
			}
			if (array.Length == 2)
			{
				array[0] = array[0].Trim();
				array[1] = array[1].Trim();
				if (string.Equals(array[0], "drain_timeout", StringComparison.InvariantCultureIgnoreCase))
				{
					ConfigBaseClass.s_bDrainTimeoutInSRCT = true;
					ConfigBaseClass.s_bFromConfigSRCT = true;
					ConfigBaseClass.srctOffset = Convert.ToInt32(array[1]);
					return;
				}
				if (string.Equals(array[1], "drain_timeout", StringComparison.InvariantCultureIgnoreCase))
				{
					ConfigBaseClass.s_bDrainTimeoutInSRCT = true;
					ConfigBaseClass.s_bFromConfigSRCT = true;
					ConfigBaseClass.srctOffset = Convert.ToInt32(array[0]);
					return;
				}
				throw new Exception();
			}
			throw new Exception();
		}

		internal static void ProcessCMCT(string value)
		{
			if (value == null)
			{
				return;
			}
			string[] array = value.Split('+');
			if (array.Length == 1)
			{
				array[0] = array[0].Trim();
				try
				{
					if (string.Equals(array[0], "timeout", StringComparison.InvariantCultureIgnoreCase))
					{
						ConfigBaseClass.s_bTimeoutInCMCT = true;
					}
					else
					{
						ConfigBaseClass.cmctOffset = Convert.ToInt32(array[0]);
					}
					ConfigBaseClass.s_bFromConfigCMCT = true;
				}
				catch
				{
					throw;
				}
				return;
			}
			if (array.Length == 2)
			{
				array[0] = array[0].Trim();
				array[1] = array[1].Trim();
				if (string.Equals(array[0], "timeout", StringComparison.InvariantCultureIgnoreCase))
				{
					ConfigBaseClass.s_bTimeoutInCMCT = true;
					ConfigBaseClass.s_bFromConfigCMCT = true;
					ConfigBaseClass.cmctOffset = Convert.ToInt32(array[1]);
					return;
				}
				if (string.Equals(array[1], "drain_timeout", StringComparison.InvariantCultureIgnoreCase))
				{
					ConfigBaseClass.s_bTimeoutInCMCT = true;
					ConfigBaseClass.s_bFromConfigCMCT = true;
					ConfigBaseClass.cmctOffset = Convert.ToInt32(array[0]);
					return;
				}
				throw new Exception();
			}
			throw new Exception();
		}

		internal static string GetProviderLocation()
		{
			return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
		}

		internal static void UpdateConfigHashtable(string Key, string Value)
		{
			ConfigBaseClass.m_configParameters[Key] = Value;
			ConfigBaseClass.m_oracleConfigParameters[Key] = Value;
		}

		public static void AddOracleTypesDeserialization()
		{
			Type[] array = new Type[14]
			{
				typeof(OracleBFile),
				typeof(OracleBinary),
				typeof(OracleBlob),
				typeof(OracleBoolean),
				typeof(OracleClob),
				typeof(OracleDate),
				typeof(OracleDecimal),
				typeof(OracleIntervalDS),
				typeof(OracleIntervalYM),
				typeof(OracleString),
				typeof(OracleTimeStamp),
				typeof(OracleTimeStampLTZ),
				typeof(OracleTimeStampTZ),
				typeof(OracleXmlType)
			};
			Type[] array2 = (Type[])AppDomain.CurrentDomain.GetData("System.Data.DataSetDefaultAllowedTypes");
			if (array2 == null)
			{
				AppDomain.CurrentDomain.SetData("System.Data.DataSetDefaultAllowedTypes", array);
				return;
			}
			List<Type> list = new List<Type>(array2);
			Type[] array3 = array;
			foreach (Type item in array3)
			{
				if (!list.Contains(item))
				{
					list.Add(item);
				}
			}
			AppDomain.CurrentDomain.SetData("System.Data.DataSetDefaultAllowedTypes", list.ToArray());
		}
	}
}
